<?php
/**
 * Created by PhpStorm.
 * User: sunzexin
 * Date: 2018/3/14
 * Time: 10:17
 */

namespace App\Http\Controllers\Admin;


use App\Http\Logics\Admin\SystemNotifyLogic;
use App\Http\Traits\SystemNotifyTrait;
use App\Http\Controllers\BaseController;
class SystemNotifyController extends BaseController
{
    use SystemNotifyTrait;

    /**
     * 获取系统通知列表
     * @return string
     */
    public function getSystemNotifyList()
    {
        $limit = $this->limit;
        $status = $this->status;
        $data = [
            'limit' => $limit,
            'status' => $status
        ];
        $response = SystemNotifyLogic::getSystemNotifyList($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    public function createSystemNotify()
    {
        $content = $this->content;
        $data = [
            'content' => $content
        ];
        $response = SystemNotifyLogic::createSystemNotify($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }
}